// src/router/index.js
import { createRouter, createWebHashHistory } from 'vue-router'
import Dashboard from '../components/Dashboard.vue'
import DeviceList from '../components/DeviceList.vue'
import Repair from '../components/Repair.vue'
import QRCodeManage from '../components/QRCodeManage.vue'
import DeviceDetail from '../components/DeviceDetail.vue'
import SpareParts from '../components/SpareParts.vue'
import UserManage from '../components/UserManage.vue'
import Login from '../components/Login.vue'
import FactoryReport from '../components/FactoryReport.vue'
import FactoryReportList from '../components/FactoryReportList.vue'
import StandardMaintain from '../components/StandardMaintain.vue'
import VersionViewer from '../components/VersionViewer.vue'
import DocumentManage from '../components/DocumentManage.vue'
import DocumentCategory from '../components/DocumentCategory.vue'
// 其它页面继续引入...

const routes = [
  // { path: '/login', component: Login }, // 移除登录路由
  { path: '/', redirect: '/dashboard' },
  { path: '/dashboard', component: Dashboard },
  { path: '/device-list', component: DeviceList },
  { path: '/repair', component: Repair },
  { path: '/qrcode', component: QRCodeManage },
  { path: '/device-detail', component: DeviceDetail },
  { path: '/spareparts', component: SpareParts },
  { path: '/user-manage', component: UserManage },
  { path: '/factory-report', component: FactoryReportList },
  { path: '/factory-report/new', component: FactoryReport },
  { path: '/factory-report/:id', component: FactoryReport },
  {
    path: '/standard-maintain',
    name: 'StandardMaintain',
    component: () => import('../components/StandardMaintain.vue')
  },
  {
    path: '/version-viewer',
    name: 'VersionViewer',
    component: VersionViewer
  },
  {
    path: '/document-manage',
    name: 'DocumentManage',
    component: DocumentManage
  },
  {
    path: '/document-manage/:category',
    name: 'DocumentCategory',
    component: DocumentCategory
  },
  // 其它页面...
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
